//
//  RMMShopingDetailsBottomView.m
//  Romomo
//
//  Created by puman on 16/10/11.
//  Copyright © 2016年 mazegong. All rights reserved.
//

#import "RMMShopingDetailsBottomView.h"

@implementation RMMShopingDetailsBottomView
- (instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        UILabel *lineLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.width, 0.5)];
        lineLabel.backgroundColor = RGBA(221, 221, 221, 1);
        [self addSubview:lineLabel];
        
        _toMartBUt = [UIButton buttonWithType:(UIButtonTypeCustom)];
        _toMartBUt.frame = CGRectMake(15, 12.5, 24, 24);
        [_toMartBUt setImage:[UIImage imageNamed:@"cart-1@3x"] forState:(UIControlStateNormal)];
        [self addSubview:_toMartBUt];
        
        _countLabel = [[UILabel alloc] initWithFrame:CGRectMake(19, _toMartBUt.top - 15, 15, 15)];
        _countLabel.backgroundColor = [UIColor redColor];
        _countLabel.layer.masksToBounds = YES;
        _countLabel.layer.cornerRadius = 7.5;
        _countLabel.textColor = kWhiteColor;
        _countLabel.font = kFont(12);
        _countLabel.hidden = YES;
        _countLabel.textAlignment = NSTextAlignmentCenter;
        [_toMartBUt addSubview:_countLabel];
        
        _buyNowBut = [UIButton buttonWithType:(UIButtonTypeCustom)];
        _buyNowBut.frame = CGRectMake(kScreenWideth - 122, 6.5, 107, 36);
        _buyNowBut.backgroundColor = kBasicColor;
        [_buyNowBut setTitleColor:kWhiteColor forState:(UIControlStateNormal)];
        _buyNowBut.titleLabel.font = kBFont(14);
        _buyNowBut.layer.masksToBounds = YES;
        _buyNowBut.layer.cornerRadius = 18;
        [_buyNowBut setTitle:@"立即购买" forState:(UIControlStateNormal)];
        [self addSubview:_buyNowBut];
        
        _addChartBut = [UIButton buttonWithType:(UIButtonTypeCustom)];
        _addChartBut.frame = CGRectMake(_buyNowBut.left - 120, 6.5, 2 * kHalf + kRow, 36);
        _addChartBut.backgroundColor = kWhiteColor;
        [_addChartBut setTitleColor:kBasicColor forState:(UIControlStateNormal)];
        _addChartBut.titleLabel.font = kBFont(14);
        _addChartBut.layer.masksToBounds = YES;
        _addChartBut.layer.borderColor = kBasicColor.CGColor;
        _addChartBut.layer.borderWidth = 1;
        _addChartBut.layer.cornerRadius = 18;
        [_addChartBut setTitle:@"加入购物车" forState:(UIControlStateNormal)];
        [self addSubview:_addChartBut];

    }
    return self;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
